home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / tcp / BBGopher10.lha / bbgopher / src / bbgopher.h < prev    next >
C/C++ Source or Header  |  1995-04-19  |  3KB  |  127 lines

  1. /*
  2.  * $VER: bbgopher.h 1.0 (20.4.95)
  3.  *
  4.  * BBGopher/amiga header file.
  5.  */
  6.  
  7. /* Version Information */
  8. char *VersTag = "\0$VER: bbgopher/amiga 1.0 (20.4.95)";
  9.  
  10. /* Defaults */
  11. #define CONFIGPATH "AMITCP:db/bbgopher.conf"
  12. #define DEFAULTTITLE "BBGopher/amiga 1.0 (%s)"
  13. #define DEFAULTPORT 70
  14. #define DEFAULTHOST "gopher"
  15. #define DEFAULTPAGER ""
  16. #define DEFAULTTELNET "telnet"
  17. #define DEFAULTTN3270 "tn3270"
  18. #define DEFAULTGIF ""
  19. #define DEFAULTIMG ""
  20. #define DEFAULTLINES 19
  21. #define DEFAULTDIR ""
  22. #define DEFAULTMAILER "sendmail"
  23. #define MAXSTACKLEN 250
  24. #define MAXMENULEN 2500
  25.  
  26. #define G_OK 0
  27. #define G_HOST 1
  28. #define G_SOCKET 2
  29. #define G_CONNECT 3
  30. #define G_STACK 4
  31. #define G_MENU 5
  32. #define G_MEMORY 6
  33. #define G_CREATE 7
  34.  
  35. typedef struct {
  36.  char type;
  37.  char *display;
  38.  char *selector;
  39.  char *hostname;
  40.  short port;
  41. } GO4ENTRY;
  42.  
  43. typedef struct {
  44.  char type;
  45.  char *display;
  46.  char acf[128];
  47.  char supported;
  48. } TYPEENTRY;
  49.  
  50. TYPEENTRY KnownTypes[] = {
  51.  { '0', "TXT", "", 1 },
  52.  { '1', "DIR", "", 1 },
  53.  { '2', "CSO", "", 0 },
  54.  { '3', "ERR", "", 0 },
  55.  { '4', "HQX", "", 1 },
  56.  { '5', "DOS", "", 1 },
  57.  { '6', "UUE", "", 1 },
  58.  { '7', "IDX", "", 1 },
  59.  { '8', "TEL", "", 1 },
  60.  { '9', "BIN", "", 1 },
  61.  { '+', "DUP", "", 0 },
  62.  { 'g', "GIF", "", 0 },
  63.  { 'I', "PIC", "", 0 },
  64.  { 'T', "TN3", "", 1 },
  65.  { 'i', "INF", "", 1 },
  66.  { 0, 0 }
  67. };
  68.  
  69. char Title[256];
  70. char DefHost[256];
  71. short DefPort;
  72. char HelpFile[256];
  73. char Pager[256];
  74. char Telnet[256];
  75. char TN3270[256];
  76. char GIFViewer[256];
  77. char IMGViewer[256];
  78. char Directory[256];
  79. char Mailer[256];
  80. char BookMark[256];
  81. char BadPorts[256];
  82. short Lines;
  83. short Twirly;
  84. short SkipACF;
  85. short SkipType;
  86. short ClearScreen;
  87. GO4ENTRY Stack[MAXSTACKLEN];
  88. short StackLen;
  89. GO4ENTRY Menu[MAXMENULEN];
  90. short MenuLen;
  91. struct sockaddr_in sain;
  92. struct hostent *host;
  93. int sock;
  94. FILE *sd;
  95. int BM;
  96.  
  97. #define NUMTWIRLYCHARS 4
  98. char TwirlyChars[NUMTWIRLYCHARS + 1] = "-\\|/";
  99.  
  100. /* Function prototypes */
  101. int ValidNumber(int number, char *string);
  102. int CheckUser(char type);
  103. int SupportedType(char type);
  104. int newEntry(GO4ENTRY *ent, char type, char *display, char *selector,
  105.  char *hostname, short port);
  106. int delEntry(GO4ENTRY *ent);
  107. char *TypeLookup(char type);
  108. int DisplayLookup(char *display);
  109. int Connect(char *selector, char *hostname, short port);
  110. void Disconnect(void);
  111. int Page(char *file);
  112. int GetData(char *file, int binary);
  113. int GetFile(char *selector, char *hostname, short port, char *type,
  114.  int binary);
  115. int MailFile(char *filename);
  116. int SaveFile(char *filename);
  117. int ReadText(char *selector, char *hostname, short port);
  118. int DoSearch(char *selector, char *hostname, short port);
  119. int ReadMenu(char *display, char *selector, char *hostname, short port,
  120.  int connect, FILE *fd);
  121. void SaveBookmark(int n);
  122. void DelBookmark(int n);
  123. int CompareEntries(GO4ENTRY *ent1, GO4ENTRY *ent2);
  124. int ReadBookmarks(void);
  125. int ProcessMenu(void);
  126. int Setup(void);
  127.